<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <title>EPICS exampleJava/serviceAPIt</title>
  <link rel="stylesheet" type="text/css"
  href="http://epics-pvdata.sourceforge.net/base.css" />
  <link rel="stylesheet" type="text/css"
  href="http://epics-pvdata.sourceforge.net/epicsv4.css" />
  <style type="text/css">
/*<![CDATA[*/
     .about { margin-left: 3em; margin-right: 3em; font-size: .83em}
     table { margin-left: auto; margin-right: auto }
     .diagram { text-align: center; margin: 2.5em 0 }
     body { margin-right: 10% }
/*]]>*/</style>

 <!-- Script that generates the Table of Contents -->
  <script type="text/javascript" src="http://epics-pvdata.sourceforge.net/script/tocgen.js"></script>

</head>

<body>

<div class="head">
<h1>EPICS exampleJava/serviceAPI</h1>
<h2 class="nocount">2016.08.26</h2>

<h2 class="nocount">Abstract</h2>
<p>The rdbService example is a complete functional server for accessing SQL databases 
such Oracle via an EPICS V4 server, and returning the resulting table ResultSet</p> 


</div> <!-- head -->

<div id="toc">
  <h2 class="nocount">Table of Contents</h2>
</div>

<!-- Place what you would like in the Table of Contents, inside the contents div -->
<div id="contents" class="contents">	  
<hr />

<h2>Overview</h2>
<p>The rdbService example is a complete functional server for accessing SQL databases 
such Oracle via an EPICS V4 server, and returning the resulting table ResultSet 
data back to an EPICS V4 client. rdbService illustrates a number of facets of EPICS V4's,
use for writing high performance synchronous servers, plus some other stuff:</p>
<ol>
 <li>channelRPC functionality of EPICSV4</li>
 <li>use of JDBC for accessing Oracle to execute a SQL query within a pattern that retries 
  the query and can rebuild the connection if any query fails - for high reliability and 
  to make sure if the database back end ever cycles, the EPICS v4 server need not be restarted.</li>
  <li>Passing string messages back to the client asynchronously - while the server is still
processing the query - in the event of the server detecting an 
error or other detecting some other diagnostic.</li>
  <li>Putting complex data into an EPICS V4 pvStructure (the basic complex data object 
of pvData), ready for returning results back to the EPICS V4 client. 
PvStructures are the basic mechanism for returning "structured" data between 
EPICS V4 clients and servers.</li>
  <li>Client side calling the server, and getting the results. </li>
  <li>Unpacking complex data out of a pvStructure</li>
   <li>Illustration of the idea of using the NTTable EPICS V4 "normative type" (though the 
definition of an NTTable is likely to change soon)</li>
  <li>Helpers for transformation of array pvData to Java Vectors</li>
   <li>Formatting pvStructure encoded data for printing.</li>
   <li>Use of the NTURI normative type, the EPICS V4 standard for passing requests for 
data and arguments.</li>
</ol>
<p>The "serviceapi" package in <strong>src/org/epics/serviceAPI</strong> is composed of a single class server and a single class
client, and is intended to illustrate the principles of RPC comms in EPICS V4. It shows
how one defines and populates the pvStructure conforming to the NTURI Normative Type, for making 
an RPC query to a pvAccess server, and it shows how the server defines and populates a table of data 
conforming to the NTTable Normative Type for encoding the reply. </p>

</div> <!-- class="contents" -->
</body>
</html>
